﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VirtualPedal;

namespace VPApp
{
	/// <summary>
	/// Interaction logic for Pedal.xaml
	/// </summary>
	public partial class PedalController : UserControl
	{
		PedalBase m_PedalDevice;

		public PedalController(PedalBase pedalDevice)
		{
			m_PedalDevice = pedalDevice;
			InitializeComponent();
			groupBox1.Header = pedalDevice.Name;
			stackPanel1.Children.Add(new BooleanTweaker("Enabled", (s, e) => { m_PedalDevice.IsEnabled = e.NewValue; }));
			foreach (var prop in m_PedalDevice.GetTweakableProperties())
			{
				var tweaker = new FloatTweaker(m_PedalDevice, prop);
				stackPanel1.Children.Add(tweaker);
			}
		}

		public string PedalName
		{
			get { return groupBox1.Header.ToString(); }
			set { groupBox1.Header = value; }
		}

		private void UserControl_Loaded(object sender, RoutedEventArgs e)
		{

		}

	}
}